import React from 'react';
import { Button, Modal } from 'antd';
import { useBoolean } from '@umijs/hooks';

import styles from './index.less';

const Index = () => {
  const { state, toggle } = useBoolean(false);
  return (
    <div className={`${styles.main} margin-top-default`}>
      <Button
        type="primary"
        onClick={() => {
          toggle();
        }}
      >
        弹框
      </Button>
      <Modal
        visible={state}
        title="实验"
        onOk={() => {
          toggle();
        }}
        onCancel={() => {
          toggle();
        }}
      >
        11
      </Modal>
    </div>
  );
};

export default Index;
